package com.liuym.common.dubbo.student.api;

import com.liuym.common.dubbo.student.dto.StudentScoreDTO;
import com.liuym.common.exception.StudentException;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @author Liuym
 * @date 2018/12/12 17:33
 * @describe：
 */
public interface StudentScoreDubboService {
    /**
     * 添加分数
     *
     * @param userName
     * @param studentScoreDTO
     * @return
     * @throws StudentException
     */
    boolean addStudentScore(String studentScoreTableName, String userName, StudentScoreDTO studentScoreDTO) throws StudentException;

    /**
     * 批量添加学生信息
     *
     * @param userName
     * @param studentScoreDTOList
     * @return
     * @throws StudentException
     */
    Map<String, Object> addStudentScoreList(String studentScoreTableName, String userName, List<StudentScoreDTO> studentScoreDTOList) throws StudentException;

    /**
     * 根据学号获得分数信息
     *
     * @param studentNumber
     * @return
     */
    List<StudentScoreDTO> getStudentScoreByStudentNumber(String studentScoreTableName, long studentNumber) throws StudentException;

    /**
     * 根据id获得分数信息
     *
     * @param id
     * @return
     */
    StudentScoreDTO getStudentScoreById(String studentScoreTableName, int id) throws StudentException;

    /**
     * 更新分数信息
     *
     * @param studentScoreDTO
     * @return
     */
    int updateStudentScore(String studentScoreTableName, StudentScoreDTO studentScoreDTO) throws StudentException;

    /**
     * 删除分数
     *
     * @param id
     * @return
     */
    int deleteStudentScore(String studentScoreTableName, int id) throws StudentException;

    /**
     * 删除分数
     *
     * @param studentNumber
     * @return
     */
    int deleteStudentScoreByNumber(String studentScoreTableName, long studentNumber) throws StudentException;

    /**
     * 获得一定时间内的分数信息
     *
     * @param startTime
     * @param endTime
     * @return
     */
    List<StudentScoreDTO> getStudentScoreByTime(String studentScoreTableName, Date startTime, Date endTime) throws StudentException;

    /**
     * 获得某个管理员操作的分数信息
     *
     * @param userName
     * @param startTime
     * @param endTime
     * @return
     */
    List<StudentScoreDTO> getStudentScoreByAdmin(String studentScoreTableName, String userName, Date startTime, Date endTime) throws StudentException;

    /**
     * 创建表
     *
     * @param studentScoreTableName
     * @return
     */
    int addStudentScoreTable(String studentScoreTableName) throws StudentException;
}
